package com.tudouji.framework.task;

import java.util.HashMap;

public class BatchStatus {
    public static ThreadLocal<HashMap> batchStatus = new ThreadLocal<>();

    public static boolean batchRunning(){
        HashMap status = batchStatus.get();
        return status!=null && status.get("batchStatus").equals("running");
    }

    public static void run(){
        HashMap status = new HashMap();
        status.put("batchStatus","running");
        batchStatus.set(status);
    }

    public static void stop(){
        batchStatus.remove();
    }
}
